{% extends "base.html" %}
{% load tags %}
{% block title %}Asmeninė ataskaita{% endblock %}
{% block content %}
<h1>Vykdomi projektai</h1>
<input type="hidden" id="allIds" value="{{ path }},{% for p in reports %}{{ p.projectId }}{% if not forloop.last %},{% endif %}{% endfor %}">
<p>
  <input type="button" class="button" value="Išskleisti visus" onClick="expandAll('allIds')">
  <input type="button" class="button" value="Suskleisti visus" onClick="collapseAll('allIds')">
</p>
<table class="reportTable thickHeader" >
  <thead>
    <tr>
      <th sort_index="0">Kodas</th>
      <th sort_index="1">Projekto pavadinimas</th>
      <th sort_index="2">Projekto vadovas</th>
      <th sort_index="3">Pradžios data</th>
      <th sort_index="4">Pabaigos data</th>
      <th sort_index="5">Nudirbta valandų</th>
      <th sort_index="6">Darbo įnašas (%)</th>
    </tr>
  </thead>
  <tbody>
    {% for r in reports %}
    <tr class="vadovas {{ forloop.counter|oddOrEven }}{% ifequal employee r.manager %} rowHighlight{% endifequal %}" onClick="process('{{ path }}/{{ r.projectId }}', 'projectWorkhours_{{ r.projectId }}')">
      <td>{{ r.projectId }}</a></td>
      <td class="left">{{ r.project }}</a></td>
      <td>{{ r.manager }}</td>
      <td>{{ r.started|date:"Y-m" }}</td>
      <td>{{ r.finished|date:"Y-m" }}</td>
      <td>{{ r.workhours }}</td>
      <td>{{ r.contribution|floatformat:1 }}</td>
    </tr><tr style="display: none;">
      <td colspan="7"><div id="projectWorkhours_{{ r.projectId }}"></div></td>
    </tr>
    {% endfor%}
  </tbody>
</table>
{% endblock %}
